package com.trkj.dao.jpa;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojos.YzrPharStock;

public interface IYzrPharStockDAO extends CrudRepository<YzrPharStock, String> {

	@Query("select c from YzrPharStock c where c.pharStockStoreId=?1")
	public List<YzrPharStock> findByPharStockStoreId(Pageable pageable,String pharStockStoreId);
	@Query("select count(*) from YzrPharStock c where c.pharStockStoreId=?1")
	public long findByPharStockcount(String pharStockStoreId);
	
	@Query("select c from YzrPharStock c where c.pharStockStoreId=?1 and c.pharStockMedId=?2")
	public YzrPharStock findByPharpharStockMedId(String pharStockStoreId,String pharStockMedId);

	@Query("select c from YzrPharStock c where c.pharStockStoreId=?1 and c.pharStockMedName like %?2%")
	public List<YzrPharStock> findByPharStockMedName(String pharStockStoreId,String pharStockMedName);
}
